using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DAL;
using DTO;
using BUS;
using Utility;

public partial class admin_ChiTiet_CauHoi_BinhLuan : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        LoadData();
    }

    private void LoadData()
    {
       try
        {
            int id = int.Parse(Request.QueryString["ID"]);
            CauHoiBinhLuan_DTO cauHoiBinhLuan = CauHoiBinhLuan_BUS.GetByID(id);
            lit_ID.Text = cauHoiBinhLuan.ID.ToString();

            KhachHang_DTO khachHang = KHACHHANG_BUS.GetByID(cauHoiBinhLuan.MaKH);
            lit_MaKH.Text = khachHang.HoTen;

            MatHang_DTO matHang = MATHANG_BUS.GetByID(cauHoiBinhLuan.MaMH);
            lit_MaMH.Text = matHang.TenMH;

            lit_NoiDung.Text = cauHoiBinhLuan.NoiDung;
            lit_Ngay.Text = cauHoiBinhLuan.Ngay.ToString();

            hp_TraLoi.NavigateUrl = "~/admin/TraLoi.aspx?id=" + cauHoiBinhLuan.ID.ToString();
        }
        catch
        {
            Response.Redirect("~/admin/CauHoi_BinhLuan.aspx");
        }
    }
    }

